<?xml version="1.0" encoding="UTF-8"?>
<html>
 <head>
  <title>Test for the WiringEditor Php Backend</title>

	<link rel="stylesheet" type="text/css" href=".././lib/yui/reset-fonts-grids/reset-fonts-grids.css" /> 

<script type="text/javascript" src="../../lib/yui/utilities/utilities.js"></script>
<script type="text/javascript" src="../../lib/yui/json/json.js"></script>
<script type="text/javascript" src="../../lib/yui-rpc.js"></script>

<script>

	YAHOO.util.Event.onDOMReady(function() {

		var service = new YAHOO.rpc.Service("WiringEditor.smd",{
				success: function() {
					
					this.saveWiring({name: "UnSuperNom de pipe !", working: YAHOO.lang.JSON.stringify({definition:"machin"}) }, {
						success: function(result) {
							console.log("result", result);
						}
					});
					
					this.listWirings({},{
						success: function(result) {
							var modules = result.result;
							modules[0].working = YAHOO.lang.JSON.parse(modules[0].working);
							
							console.log(modules);
						}
					}
					);
					
					this.loadWiring({name: "UnSuperNom de pipe !"},{
						success: function(result) {
							console.log("result", result);
						}
					});
					
					
					this.deleteWiring({name: "UnSuperNom de pipe !"},{
						success: function(result) {
							console.log("result", result);
						}
					});
					
				},
				failure: function(o) {}
		});

	});


</script>
	

 </head>

 <body>

 </body>
</html>
